



/*
Filename: A2_AssignParentNamesHolding.do
Goal: Assign parent company names to mutual fund entities based on institutional ownership structures and corporate history.
Contact: mjha@gsu.edu (author) and gormley@wustl.edu

Data Requirements: No external datasets required beyond CRSP institutional name data
*/


gsort caldt
/* Clean "mgmt_name" to ease identifying */
gen mgmt_name_orig = mgmt_name
label var mgmt_name_orig "Original CRSP mgmt_name"

replace mgmt_name = strupper(mgmt_name)  
replace mgmt_name = subinstr(mgmt_name, char(34), "", .)  
replace mgmt_name = subinstr(mgmt_name, ",", "", .)  
replace mgmt_name = strtrim(mgmt_name)  
replace mgmt_name = substr(mgmt_name, 1, length(mgmt_name)-1) if regexm(mgmt_name, "\.$")  

replace mgmt_name = substr(mgmt_name, 1, length(mgmt_name)-4) if strpos(mgmt_name, "INC") == length(mgmt_name)-2
replace mgmt_name = substr(mgmt_name, 1, length(mgmt_name)-8) if strpos(mgmt_name, "LIMITED") == length(mgmt_name)-6
replace mgmt_name = substr(mgmt_name, 1, length(mgmt_name)-4) if strpos(mgmt_name, "LTD") == length(mgmt_name)-2
replace mgmt_name = substr(mgmt_name, 1, length(mgmt_name)-4) if strpos(mgmt_name, "LLC") == length(mgmt_name)-2
replace mgmt_name = substr(mgmt_name, 1, length(mgmt_name)-4) if strpos(mgmt_name, "LLP") == length(mgmt_name)-2
replace mgmt_name = substr(mgmt_name, 1, length(mgmt_name)-6) if strpos(mgmt_name, "L.L.C") == length(mgmt_name)-4
replace mgmt_name = substr(mgmt_name, 1, length(mgmt_name)-3) if strpos(mgmt_name, "LP") == length(mgmt_name)-1
replace mgmt_name = substr(mgmt_name, 1, length(mgmt_name)-4) if strpos(mgmt_name, "L.P") == length(mgmt_name)-2
replace mgmt_name = subinstr(mgmt_name, "CO", "COMPANY",.) if strpos(mgmt_name, "CO") == length(mgmt_name)-1
replace mgmt_name = subinstr(mgmt_name, "INV MGMT", "INVESTMENT MANAGEMENT",.)
replace mgmt_name = subinstr(mgmt_name, "MGMT", "MANAGEMENT",.)
replace mgmt_name = subinstr(mgmt_name, "MANAGEMENT.", "MANAGEMENT",.)

gen fund_name_orig = fund_name
label var fund_name_orig "Original CRSP fund_name"
replace fund_name = upper(fund_name)

/* Data sanity check */
count if missing(mgmt_name) & !missing(mgmt_cd)
count if missing(mgmt_cd) & !missing(mgmt_name)

/* Fill in missing "mgmt_cd" */
sort mgmt_name mgmt_cd
egen tag = tag(mgmt_name mgmt_cd) 
by mgmt_name: replace tag = sum(tag)  
by mgmt_name: replace tag = tag[_N] 
bysort mgmt_name: replace mgmt_cd = mgmt_cd[_N] if missing(mgmt_cd) & tag == 1 
drop tag

/* Fill in missing "mgmt_name" */
sort   caldt mgmt_cd mgmt_name
bysort caldt mgmt_cd: replace mgmt_name = mgmt_name[_N] if missing(mgmt_name) & !missing(mgmt_cd)

/* Fill in missing "fund_name" */
sort   caldt crsp_fundno fund_name
bysort caldt crsp_fundno: replace fund_name = fund_name[_N] if missing(fund_name) & !missing(crsp_fundno)

/* Fill in missing "crsp_portno" */
sort   caldt crsp_fundno crsp_portno
bysort caldt crsp_fundno: replace crsp_portno = crsp_portno[_N] if missing(crsp_portno) & !missing(crsp_fundno)


gen family_name = mgmt_name
sort mgmt_cd caldt
bysort mgmt_cd: replace family_name = family_name[_N] if !missing(mgmt_cd) & !missing(family_name[_N])


replace family_name="AAL" if strpos(mgmt_name, "AAL") & caldt <= mdy(1,1,2005)
replace family_name="ABERDEEN" if strpos(mgmt_name, "ABERDEEN")
replace family_name="ABN AMRO" if strpos(mgmt_name, "ABN AMRO")
replace family_name="ABSOLUTE" if mgmt_cd=="ABM" | mgmt_cd=="APW" | mgmt_cd=="ABC" | strpos(mgmt_name, "ABSOLUTE CAPITAL MANAGEMENT") | strpos(mgmt_name, "ABSOLUTE INVESTMENT MANAGEMENT") | strpos(mgmt_name, "ABSOLUTE PRIVATE WEALTH MANAGEMENT")
replace family_name="ADDISON CAPITAL" if strpos(mgmt_name, "ADDISON CAPITAL")
replace family_name="ADVANTUS CAPITAL" if strpos(mgmt_name, "ADVANTUS CAPITAL")
replace family_name="AEGIS FINANCIAL CORPORATION" if mgmt_cd=="BGB"  
replace family_name="AETNA LIFE" if strpos(mgmt_name, "AETNA LIFE")
replace family_name="AFBA 5STAR" if strpos(mgmt_name, "AFBA")
replace family_name="AIB GOVETT" if strpos(mgmt_name, "AIB GOVETT")
replace family_name="AIG" if mgmt_cd=="AIG" | strpos(mgmt_name,"SUNAMERICA") | mgmt_cd=="SAM" | strpos(mgmt_name,"AIG") 
replace family_name="AIM" if strpos(fund_name, "AIM") & caldt <= mdy(6,1,2010)  
replace family_name="ALEX & BROWN" if strpos(mgmt_name, "ALEX BROWN") | mgmt_cd=="ABI"
replace family_name="ALLEGIANT" if strpos(fund_name, "ALLEGIANT")
replace family_name="ALLIANCE CAPITAL" if strpos(mgmt_name, "ALLIANCE CAPITAL") & caldt <= mdy(7,1,2001)  
replace family_name="ALLIANCEBERNSTEIN" if mgmt_cd== "ALL" | strpos(mgmt_name, "ALLIANCEBERNSTEIN") | strpos(mgmt_name, "ALLIANCE CAPITAL") & caldt > mdy(7,1,2001)
replace family_name="ALLIANZ" if mgmt_cd== "ALZ" | strpos(mgmt_name, "ALLIANZ")
replace family_name="ARK" if strpos(mgmt_name, "ALLFIRST")
replace family_name="ALPINE MANAGEMENT & RESEARCH" if mgmt_cd== "ALP" | strpos(mgmt_name, "ALPINE MANAG") | strpos(mgmt_name, "ALPINE WOODS") 
replace family_name="ALPS" if mgmt_cd== "APS" | strpos(mgmt_name, "ALPS ADVIS") | strpos(fund_name, "ALPS")
replace family_name="AMERICAN BEACON ADVISORS" if strpos(mgmt_name, "AMERICAN BEACON") | strpos(mgmt_name, "AMR INVESTMENT")
replace family_name="AMERICAN CENTURY" if strpos(mgmt_name, "AMERICAN CENTURY")
replace family_name="AMERICAN HERITAGE" if strpos(mgmt_name, "AMERICAN HERITAGE")
replace family_name="AMERICAN SKANDIA" if strpos(mgmt_name, "AMERICAN SKANDIA")
replace family_name="AMERICAN TRUST" if strpos(mgmt_name, "AMERICAN TRUST")
replace family_name="AMERINDO" if strpos(mgmt_name, "AMERINDO")
replace family_name="AMERIPRISE" if strpos(mgmt_name, "AMERICAN EXPRESS") | strpos(mgmt_name, "AMERIPRISE") | mgmt_cd=="AXP"
replace family_name="AMERISTOCK" if strpos(mgmt_name, "AMERISTOCK") | mgmt_cd=="AMI"
replace family_name="ANCHOR" if strpos(mgmt_name, "ANCHOR CAPITAL") | mgmt_cd=="AMG"  
replace family_name="AON" if strpos(mgmt_name, "AON ADVISORS") | strpos(mgmt_name, "AON SECURITIES")

replace family_name="AQUILA" if strpos(mgmt_name, "AQUILA") | mgmt_cd=="AQM"
replace family_name="ARIEL" if strpos(mgmt_name, "ARIEL CAPITAL") | mgmt_cd=="ARI"
replace family_name="ARNHOLD & S. BLEICHROEDER" if strpos(mgmt_name, "ARNHOLD") & strpos(mgmt_name, "BLEICHROEDER")
replace family_name="ARISTOTLE" if (mgmt_cd== "ARS" | mgmt_cd== "ATT" | mgmt_cd== "ACB" | mgmt_cd== "AAP" | strpos(mgmt_name, "ARISTOTLE")) & !strpos(mgmt_name, "ARISTON")

replace family_name="ARROW INVESTMENT" if strpos(mgmt_name, "ARROW INVESTMENT")
replace family_name="ARTISAN PARTNERS" if strpos(mgmt_name, "ARTISAN PARTNERS") | mgmt_cd=="ART"

replace family_name="AST INVESTMENT SERVICES" if strpos(family_name,"AST INVESTMENT SERIVCES")
replace family_name="ASTER" if strpos(mgmt_name, "ASTER") & !strpos(mgmt_name, "EASTERN")
replace family_name="ASTOR" if mgmt_cd== "AAS" | mgmt_cd=="ATM" | strpos(mgmt_name, "ASTOR")

replace family_name="AVATAR INVESTORS" if strpos(mgmt_name, "AVATAR INVESTORS")
replace family_name="AXA" if strpos(mgmt_name, "AXA") |  strpos(mgmt_name, "ROSENBURG")
replace family_name="BAILARD BIEHL & KAISER" if strpos(mgmt_name, "BAILARD BIEHL") | strpos(mgmt_name, "KAISER") | mgmt_cd=="BBK"
replace family_name="BAMCO" if strpos(mgmt_name, "BAMCO")
replace family_name="BANC ONE" if strpos(mgmt_name, "BANC ONE") | (strpos(fund_name, "ONE GROUP")  & !strpos(fund_name, "PARKSTONE"))
replace family_name="BANK OF AMERICA" if mgmt_cd== "BOA"
replace family_name="BANK OF NEW YORK" if strpos(mgmt_name, "BANK OF NEW YORK")  
replace family_name="BANK OF HAWAII" if mgmt_cd=="PCE" 
replace family_name="BARCLAYS" if mgmt_cd== "BRC" | mgmt_cd== "BZW" | strpos(mgmt_name, "BARCLAYS")
replace family_name="BAXTER FINANCIAL" if strpos(mgmt_name, "BAXTER FINANCIAL")
replace family_name="BB&T" if strpos(mgmt_name, "BB&T") | (!strpos(mgmt_name, "STERLING") & mgmt_cd=="BBT")
replace family_name="BEAR STEARNS" if mgmt_cd== "BSM" | mgmt_cd== "BRS" | strpos(mgmt_name, "BEAR STEARNS")
replace family_name="BERGER ASSOCIATES" if strpos(mgmt_name, "BERGER ASSOCIATES") | mgmt_cd=="BER"
replace family_name="BERKSHIRE" if mgmt_cd== "BRK" | mgmt_cd== "BEA" | strpos(mgmt_name, "BERKSHIRE")
replace family_name="BESSEMER" if strpos(mgmt_name, "BESSEMER") | mgmt_cd=="BES"
replace family_name="BHIRUD ASSOCIATES" if strpos(mgmt_name, "BHIRUD ASSOCIATES")
replace family_name="BLACKROCK" if mgmt_cd== "BLK" | mgmt_cd=="BZW" | strpos(mgmt_name, "BLACKROCK") | strpos(fund_name, "BLACKROCK")
replace family_name="BLACKSTONE" if strpos(mgmt_name, "BLACKSTONE") 
replace family_name="BNYM" if mgmt_cd=="BNM"
replace family_name="BMO" if strpos(mgmt_name, "BMO")
replace family_name="BOSTON ADVISORS" if (mgmt_cd== "BST" | mgmt_cd== "BAA" | strpos(mgmt_name, "BOSTON ADVISORS")) & !strpos(mgmt_name, "BLACKSTONE") 
replace family_name="BOYLE" if mgmt_cd== "BYL" | mgmt_cd=="BYC" | strpos(mgmt_name, "BOYLE")
replace family_name="BRAMWELL CAPITAL" if strpos(mgmt_name, "BRAMWELL CAPITAL")
replace family_name="BRANDES INVESTMENT" if strpos(mgmt_name, "BRANDES INVESTMENT") | mgmt_cd=="BIP"
replace family_name="BRAZOS" if mgmt_cd=="JMC" 
replace family_name="BREMER" if strpos(mgmt_name, "BREMER") | mgmt_cd=="BMR"
replace family_name="BRIDGES" if strpos(mgmt_name, "BRIDGES INVESTMENT") | mgmt_cd=="BIC"
replace family_name="BRIDGEWAY CAPITAL" if strpos(mgmt_name, "BRIDGEWAY CAPITAL")
replace family_name="BROWN ADVISORY" if mgmt_cd== "BAF" | mgmt_cd=="BAV"| mgmt_cd=="BIA" | strpos(mgmt_name, "BROWN ADVISORY") 
replace family_name="BROWN BROS HARRIMAN" if strpos(mgmt_name, "BROWN BRO")
replace family_name="BRUCE" if strpos(mgmt_name, "BRUCE FUND") | mgmt_cd=="BRU"
replace family_name="BRUNDAGE STORY & ROSE" if strpos(mgmt_name, "BRUNDAGE STORY")
replace family_name="BURNHAM ASSET MANAGEMENT" if strpos(mgmt_name, "BURNHAM ASSET") | mgmt_cd=="BUR"
replace family_name="CALAMOS" if strpos(mgmt_name, "CALAMOS") | mgmt_cd=="CLM"
replace family_name="CANANDAIGUA NATL BANK" if strpos(mgmt_name, "CANANDAIGUA NATL BANK")
replace family_name="CALLAN ASSOCIATES" if strpos(mgmt_name, "CALLAN ASSOCIATES")
replace family_name="CALVERT" if mgmt_cd== "CAL" | strpos(mgmt_name, "CALVERT RESEARCH") | strpos(mgmt_name, "CALVERT ASSET MANAGEMENT CO") | strpos(mgmt_name, "CALVERT INVESTMENTS INC") 
replace family_name="CANCELMO CAPITAL MANAGEMENT" if strpos(mgmt_name, "CANCELMO CAPITAL MANAGEMENT")
replace family_name="CAPITAL GROWTH" if mgmt_cd== "CGM" | strpos(mgmt_name, "CAPITAL GROWTH M")
replace family_name="CAPITAL GUARDIAN" if mgmt_cd== "CGD" | mgmt_cd== "CPG" | strpos(mgmt_name, "CAPITAL GUARDIAN")
replace family_name="CAPITAL ONE" if strpos(mgmt_name, "CAPITAL ONE NATIONAL ASSOCIATION")
replace family_name="CAPSTONE" if mgmt_cd== "CAP" | strpos(mgmt_name, "CAPSTONE ASSET") | strpos(mgmt_name, "CAPSTONE INVESTMENT FINANCIAL")

replace family_name="CATERPILLAR INV" if strpos(mgmt_name, "CATERPILLAR INV")
replace family_name="CENTRE ASSET MANAGEMENT" if strpos(mgmt_name, "CENTRE ASSET MANAGEMENT")
replace family_name="CENTURION COUNSEL" if strpos(mgmt_name, "CENTURION T.A.A. FUND") | strpos(mgmt_name, "CENTURION COUNSEL") | mgmt_cd=="CCO"
replace family_name="CENTURY CAPITAL MANAGEMENT" if (mgmt_cd== "CNT" | strpos(mgmt_name, "CENTURY CAPITAL") | strpos(mgmt_name, "CENTURY SHARES TRUST")) & !strpos(mgmt_name, "GREEN")
replace family_name="CHARLES SCHWAB" if (mgmt_cd== "CSW" | strpos(mgmt_name, "CHARLES SCHWAB")) 
replace family_name="CHASE INVESTMENT COUNSEL CORP" if strpos(mgmt_name, "CHASE INVESTMENT COUNSEL CORP") 

replace family_name="CITI" if mgmt_cd== "CTI" | strpos(mgmt_name, "CITIGROUP") | strpos(mgmt_name, "CITIBANK") | strpos(mgmt_name, "CITIFUND")| strpos(mgmt_name, "CITISTREET")| strpos(mgmt_name, "CITI FUND MANAGEMENT INC") | mgmt_cd=="CIT" | mgmt_cd=="CFM" 
replace family_name="CITIZENS ADVISERS" if strpos(mgmt_name, "CITIZENS ADVISERS") | strpos(mgmt_name, "CITIZENS TRUST")
replace family_name="CITIZENS BANK" if mgmt_cd== "CTZ" | strpos(mgmt_name, "CITIZENS BANK") | strpos(mgmt_name, "CITIZENS COMMERCIAL")
replace family_name="CITY NATIONAL" if mgmt_cd== "CNB" | mgmt_cd== "ROC"| strpos(mgmt_name, "CITY NATIONAL")
replace family_name="CLARK CAPITAL" if mgmt_cd== "CCG" | mgmt_cd== "CLK" |strpos(mgmt_name, "CLARK CAPITAL")
replace family_name="CLAYMORE" if strpos(mgmt_name, "CLAYMORE")
replace family_name="CLOUD" if strpos(mgmt_name, "CLOUD") 
replace family_name="COHEN & STEERS" if strpos(mgmt_name, "COHEN & STEERS")
replace family_name="COLE REAL ESTATE" if mgmt_cd== "CRI" | mgmt_cd== "CLE" | strpos(mgmt_name, "COLE REAL ESTATE")
replace family_name="COLONIAL" if strpos(mgmt_name, "COLONIAL MANAGEMENT ASSOCIATES")
replace family_name="COLUMBIA" if mgmt_cd== "LBR" | mgmt_cd== "COL" | strpos(mgmt_name, "COLUMBIA FUNDS") | strpos(mgmt_name, "COLUMBIA WANGER")
replace family_name="COMMERCE" if mgmt_cd== "CCA" | mgmt_cd== "CMI" | mgmt_cd== "COM" | strpos(mgmt_name, "COMMERCE BANK N.A.")
replace family_name="COMMUNITY CAPITAL MANAGEMENT" if strpos(mgmt_name, "COMMUNITY CAPITAL MANAGEMENT") 
replace family_name="CONCORDE" if strpos(mgmt_name, "CONCORDE") | mgmt_cd=="CFC"
replace family_name="CONSECO" if strpos(mgmt_name, "CONSECO") | mgmt_cd=="CON" 

replace family_name="COPLEY FINANCIAL" if strpos(mgmt_name, "COPLEY FINANCIAL")
replace family_name="CORNERSTONE" if (mgmt_cd== "COR" | mgmt_cd== "CEA" | strpos(mgmt_name, "CORNERSTONE")) & mgmt_cd!="CAM" & mgmt_cd!="CCI" & mgmt_cd!="CAI" 
replace family_name="CRABBE HUSON" if strpos(mgmt_name, "CRABBE HUSON")
replace family_name="CREDIT SUISSE" if strpos(mgmt_name, "CREDIT SUISSE")
replace family_name="CROFT-LEOMINSTER" if strpos(mgmt_name, "CROFT-LEOMINSTER")
replace family_name="CSI CAPITAL" if strpos(mgmt_name, "CSI CAPITAL")
replace family_name="CUNA" if strpos(mgmt_name, "CUNA MUTUAL") | mgmt_cd=="CUN" | mgmt_cd=="CIM"
replace family_name="CUSHING MLP ASSET MANAGEMENT LP" if strpos(mgmt_name, "CUSHING MLP ASSET MANAGEMENT LP") 
replace family_name="CUTWATER" if strpos(mgmt_name, "CUTWATER") | mgmt_cd=="MBI"
replace family_name="DARUMA" if strpos(mgmt_name, "DARUMA")
replace family_name="DAVID L. BABSON & CO" if strpos(mgmt_name, "DAVID L. BABSON & CO") | strpos(mgmt_name, "BABSON CAPITAL") 
replace family_name="DAVID W. TICE" if strpos(mgmt_name, "DAVID") & strpos(mgmt_name, "TICE")
replace family_name="DEARBORN" if mgmt_cd== "DRB" | mgmt_cd== "DRP" | strpos(mgmt_name, "DEARBORN")
replace family_name="DECLARATION INVESTMENT" if strpos(mgmt_name, "DECLARATION INVESTMENT")
replace family_name="DELAWARE MANAGEMENT COMPANY" if strpos(mgmt_name, "DELAWARE MANAGEMENT") | mgmt_cd=="DEL"
replace family_name="DEUTSCHE" if mgmt_cd== "DBL" | strpos(mgmt_name, "DEUTSCHE") | strpos(mgmt_name, "DWS")
replace family_name="DFA" if mgmt_cd== "DFA" | strpos(mgmt_name, "DIMENSIONAL FUND ADVI")
replace family_name="DIAMOND HILL" if strpos(mgmt_name, "HEARTLAND ADVISORY GROUP") | strpos(mgmt_name, "DIAMOND HILL") 
replace family_name="DIVERSIFIED INVESTMENT ADVISORS" if strpos(mgmt_name, "DIVERSIFIED INVESTMENT") | mgmt_cd=="DVF"
replace family_name="DODGE & COX" if mgmt_cd== "DNC" | strpos(mgmt_name, "DODGE & COX")
replace family_name="DOUBLELINE" if mgmt_cd== "DLC" | mgmt_cd== "DLF" | strpos(mgmt_name, "DOUBLELINE")
replace family_name="DREYFUS" if mgmt_cd== "DRY" | strpos(mgmt_name, "DREYFUS")
replace family_name="DRIEHAUS" if strpos(mgmt_name, "DRIEHAUS") | mgmt_cd=="DRI"
replace family_name="DUPREE" if strpos(mgmt_name, "DUPREE") | mgmt_cd=="DUP"
replace family_name="EAGLE ASSET MANAGEMENT" if strpos(mgmt_name, "EAGLE ASSET MANAGEMENT") | mgmt_cd=="CLT"
replace family_name="EATON VANCE" if strpos(mgmt_name, "EATON VANCE") | mgmt_cd=="EAT" 
replace family_name="EHRENKRANTZ" if strpos(mgmt_name, "EHRENKRANTZ") | mgmt_cd=="EKN"
replace family_name="EMERALD" if mgmt_cd== "EMR" | strpos(mgmt_name, "EMERALD ADVISERS INC") | strpos(mgmt_name, "EMERALD MUTUAL FUND ADVISERS TRUST")  | strpos(mgmt_name, "EMERALD ADVISERS") 
replace family_name="ENTERPRISE CAPITAL M" if strpos(mgmt_name, "ENTERPRISE CAPITAL M") | mgmt_cd=="ENT"
replace family_name="EQUITY ANALYSTS INC" if strpos(mgmt_name, "EQUITY ANALYSTS")
replace family_name="EULAV" if strpos(mgmt_name, "EULAV") | mgmt_cd=="VAL" 
replace family_name="ETF SECURITIES" if strpos(mgmt_name, "ETF SECURITIES")
replace family_name="EQUINOX" if mgmt_cd== "EQI" | mgmt_cd== "EQM" | strpos(mgmt_name, "EQUINOX")
replace family_name="EQUITRUST" if strpos(mgmt_name, "EQUITRUST")
replace family_name="EVALUATION ASSOC CAP MKTS" if strpos(mgmt_name, "EVALUATION ASSOC") | mgmt_cd=="EVL"
replace family_name="EVERGREEN" if mgmt_cd== "EVK" | strpos(mgmt_name, "EVERGREEN ASSET MANAGEMENT") |  strpos(mgmt_name, "EVERGREEN INVESTMENT MANAGEMENT")
replace family_name="FACTOR ADVISORS" if strpos(mgmt_name, "FACTOR ADVISORS")
replace family_name="FAF" if strpos(mgmt_name, "FAF") | strpos(fund_name, "FIRST AMERICAN")
replace family_name="FEDERATED" if strpos(mgmt_name, "FEDERATED") | mgmt_cd=="FED"
replace family_name="FENIMORE" if strpos(mgmt_name, "FENIMORE")
replace family_name="FIDELITY" if (mgmt_cd== "FID" | mgmt_cd== "FDS" | strpos(mgmt_name, "FIDELITY")) & !regex(mgmt_name, "FIRST")
replace family_name="FIDUCIARY ASSET MANAGEMENT" if strpos(mgmt_name, "FIDUCIARY ASSET MANAGEMENT")
replace family_name="FIDUCIARY MANAGEMENT INC" if (mgmt_cd== "FDU" | strpos(mgmt_name, "FIDUCIARY MANAGEMENT")) & !strpos(mgmt_name, "ASSOCIATES")
replace family_name="FIDUCIARY MANAGEMENT ASSOCIATES" if mgmt_cd== "FMA" | (strpos(mgmt_name, "FIDUCIARY") & strpos(mgmt_name, "ASSOCIATES"))
replace family_name="FIERA" if strpos(mgmt_name, "FIERA")
replace family_name="FFCM" if strpos(mgmt_name,"FFCM")
replace family_name="FIRST NATL BANK OF OMAHA" if strpos(mgmt_name,"BANK OF OMAHA") | strpos(mgmt_name, "TRIBUTARY CAPITAL MANAGEMENT") | strpos(fund_name, "FIRST FOCUS")
replace family_name="FIRST DATA INVESTOR SERVICES GROUP" if strpos(mgmt_name, "FIRST DATA INVESTOR")
replace family_name="FIRST EAGLE" if strpos(mgmt_name, "FIRST EAGLE")
replace family_name="FIRST INVESTORS" if mgmt_cd== "FIM" | strpos(mgmt_name, "FIRST INVESTORS MANAGEMENT") | strpos(mgmt_name, "FIRST INVESTORS MGMT CO") 
replace family_name="FIRST SECURITY" if strpos(mgmt_name, "FIRST SECURITY") 
replace family_name="FIRST TRUST" if mgmt_cd== "FTA" | strpos(mgmt_name, "FIRST TRUST")
replace family_name="FIRST WESTERN" if strpos(mgmt_name, "FIRST WESTERN") 
replace family_name="FIFTH THIRD" if strpos(mgmt_name, "FIFTH THIRD") 
replace family_name="FIRST PACIFIC ADVISORS" if strpos(mgmt_name, "FIRST PACIFIC ADVISORS") | mgmt_cd=="FPA"
replace family_name="FIRSTAR" if strpos(mgmt_name, "FIRSTAR")

replace family_name="FISHER INVESTMENT" if strpos(mgmt_name, "FISHER INVESTMENT") | mgmt_cd=="FIS"
replace family_name="FLIPPIN BRUCE & PORTER" if strpos(mgmt_name, "FLIPPIN BRUCE & PORTER")
replace family_name="FORTIS" if strpos(mgmt_name, "FORTIS") | mgmt_cd=="FOR"
replace family_name="FORUM" if strpos(mgmt_name, "FORUM") | mgmt_cd=="FAI" 
replace family_name="FORWARD" if strpos(mgmt_name, "FORWARD")
replace family_name="FOUNDERS ASSET MANAGEMENT" if strpos(mgmt_name, "FOUNDERS ASSET M") | mgmt_cd=="FND"
replace family_name="FRANK RUSSELL INV MGMT" if strpos(mgmt_name, "FRANK RUSSELL") | mgmt_cd=="RFD"
replace family_name="FRANKLIN TEMPLETON" if strpos(mgmt_name, "FRANKLIN TEMPLETON")  | strpos(mgmt_name, "FRANKLIN DISTRIBUTORS") | strpos(mgmt_name, "FRANKLIN ALT STRATEGIES") | strpos(mgmt_name, "TEMPLETON FUNDS") | mgmt_cd=="FRA" 
replace family_name="FRED ALGER" if strpos(mgmt_name, "FRED ALGER") | mgmt_cd=="ALG"
replace family_name="FREEDOM CAPITAL MANAGEMENT" if strpos(mgmt_name, "FREEDOM CAPITAL") | mgmt_cd=="FRE"
replace family_name="FREEDOM FUNDS MANAGEMENT" if strpos(mgmt_name, "FREEDOM FUNDS") | mgmt_cd=="FRD"
replace family_name="FREEDOM INVESTORS CORP" if strpos(mgmt_name, "FREEDOM INVESTORS CORP") | mgmt_cd=="FIC"
replace family_name="FREMONT INVESTMENT ADVISORS" if strpos(mgmt_name, "FREMONT INVESTMENT") | mgmt_cd=="FIA"
replace family_name="FRIESS ASSOCIATES" if strpos(mgmt_name, "FRIESS ASSOCIATES") | mgmt_cd=="FIE"
replace family_name="FRONTEGRA" if strpos(mgmt_name, "FRONTEGRA") | mgmt_cd=="FRT"
replace family_name="FURMAN ANDERSON" if strpos(mgmt_name, "FURMAN ANDERSON")
replace family_name="GABELLI" if strpos(fund_name, "GABELLI") | strpos(fund_name, "GAMCO") | strpos(fund_name, "COMSTOCK FUNDS") | strpos(fund_name, "NED DAVIS")
replace family_name="GARTMORE" if strpos(fund_name, "GARTMORE")
replace family_name="GATEWAY INVESTMENT ADVISERS" if strpos(mgmt_name, "GATEWAY INV") | mgmt_cd=="GIA"
replace family_name="GE ASSET MANAGEMENT" if strpos(mgmt_name, "GE ASSET MANAGEMENT INC") | strpos(mgmt_name, "GENERAL ELECTRIC") | mgmt_cd=="GEE"
replace family_name="GINTEL" if strpos(mgmt_name, "GINTEL EQUITY") | mgmt_cd=="GIN" 
replace family_name="GLENMEDE" if strpos(mgmt_name, "GLENMEDE TRUST") | mgmt_cd=="GLT"
replace family_name="GLOBAL ASSET MANAGEMENT" if strpos(mgmt_name, "GLOBAL ASSET MANAGEMENT (USA) INC") | mgmt_name=="GLOBAL ASSET MGMT" | mgmt_cd== "GAM" 
replace family_name="GOLDMAN SACHS" if strpos(mgmt_name, "GOLDMAN SACHS")
replace family_name="GRANITESHARES" if mgmt_cd=="GSA"
replace family_name="GRANUM CAPITAL MANAGEMENT" if strpos(mgmt_name, "GRANUM CAPITAL MANAGEMENT")
replace family_name="GRANTHAM MAYO VAN OTTERLOO & CO" if strpos(mgmt_name, "GRANTHAM MAYO VAN")
replace family_name="GREEN CENTURY CAPITAL MANAGEMENT" if strpos(mgmt_name, "GREEN CENTURY CAP") | mgmt_cd=="GCC"
replace family_name="GREENVILLE CAPITAL MANAGEMENT" if strpos(mgmt_name, "REENVILLE CAP") | mgmt_cd=="GCM"
replace family_name="GUARDIAN INVESTOR SERVICES" if strpos(mgmt_name, "GUARDIAN INV") | mgmt_cd=="GIS"
replace family_name="GUGGENHEIM" if strpos(fund_name, "GUGGENHEIM")
replace family_name="GUINNESS FLIGHT INVESTMENT" if strpos(mgmt_name, "GUINNESS FLIGHT") | mgmt_cd=="GUI"
replace family_name="GW CAPITAL" if strpos(mgmt_name, "GW CAPITAL")
replace family_name="HANCOCK" if mgmt_name=="HANCOCK HORIZON FUNDS"| mgmt_name=="HANCOCK BANK"| mgmt_cd=="HHF" | mgmt_cd=="HNC"
replace family_name="HARBOR CAPITAL" if strpos(mgmt_name, "HARBOR CAPITAL")
replace family_name="HARRIS BRETALL SULLIVAN & SMITH " if strpos(mgmt_name, "HARRIS BRETALL SULLIVAN")
replace family_name="HARRIS TRUST" if mgmt_cd=="HTS" & !strpos(fund_name, "BMO") & !strpos(mgmt_name, "BMO")
replace family_name="HARTFORD" if strpos(mgmt_name, "HARTFORD") | mgmt_cd=="HRT"
replace family_name="HATTERAS" if mgmt_cd== "HCI" | strpos(mgmt_name, "HATTERAS") | mgmt_cd=="AIP" 
replace family_name="HEARTLAND" if strpos(mgmt_name, "HEARTLAND") & !strpos(mgmt_name, "HEARTLAND ADVISORY GROUP") 
replace family_name="HENNESSY" if mgmt_cd== "HEN" | strpos(mgmt_name, "HENNESSY") | strpos(mgmt_name, "HENESSY")
replace family_name="HENSSLER" if mgmt_cd== "HNL" | strpos(mgmt_name, "HENSSLER")
replace family_name="HERBERT R. SMITH" if strpos(mgmt_name, "HERBERT R.")

replace family_name="HIGHLAND" if strpos(mgmt_name, "HIGHLAND") & !strpos(mgmt_name, "HIGHLAND ASSOCIATES")
replace family_name="HILLIARD LYONS" if strpos(mgmt_name, "HILLIARD LYONS") | mgmt_cd=="HIL"
replace family_name="HODGES CAPITAL MANAGEMENT" if strpos(mgmt_name, "HODGES CAPITAL")
replace family_name="HOLLAND" if mgmt_cd=="HLL" | strpos(mgmt_name, "HOLLAND CAPITAL MANAGEMENT") & !strpos(mgmt_name, "COMPANY") 
replace family_name="HOTCHKIS & WILEY" if strpos(mgmt_name, "HOTCHKIS") & strpos(mgmt_name, "WILEY")

replace family_name="HUNTINGTON" if strpos(mgmt_name, "HUNTINGTON") | mgmt_cd=="HUN" 
replace family_name="IDEX" if strpos(mgmt_name, "IDEX MANAGEMENT") | mgmt_cd=="IDX"
replace family_name="INCLINE" if strpos(mgmt_name, "INCLINE")

replace family_name="ING/VOYA" if mgmt_cd== "PLG" | mgmt_cd== "ING"| strpos(mgmt_name, "ING FUND") | strpos(mgmt_name, "ING INVEST") | strpos(mgmt_name, "ING PARTNERS") | strpos(mgmt_name, "ING VARIABLE") | strpos(mgmt_name, "ING VP BALANCED") | strpos(mgmt_name, "ING LIFE INSURANCE") | strpos(mgmt_name, "VOYA INVEST") | strpos(mgmt_name, "DIRECTED SERVICES")

replace family_name="INSIGHT CAPITAL MANAGEMENT" if strpos(mgmt_name, "INSIGHT CAPITAL M") 
replace family_name="INTEGRITY MANAGEMENT" if mgmt_cd== "IMR" | strpos(mgmt_name, "INTEGRITY INVESTMENTS") 
replace family_name="INTERACTIVE RESEARCH ADV" if strpos(mgmt_name, "INTERACTIVE RESEARCH ADV") | mgmt_cd=="ITR"
replace family_name="INTERNATIONAL STRATEGY & INVESTMENT" if strpos(mgmt_name, "INTERNAT'L STRATEGY & INVESTMENT") | mgmt_cd=="ISI"
replace family_name="INVESCO" if (mgmt_cd=="AIM" & caldt > mdy(6,1,2010)) | strpos(fund_name, "INVESCO") | mgmt_cd=="PWR" | mgmt_cd=="ICA" | crsp_portno==1004211

replace family_name="INVESTMENT ADVISERS INC" if mgmt_name=="INVESTMENT ADVISERS" | mgmt_cd=="IAI" 
replace family_name="INVESTORS MANAGEMENT GROUP" if strpos(mgmt_name, "INVESTORS MANAGEMENT GROUP") | mgmt_cd=="IMG" 
replace family_name="INVESTORS SECURITY CO" if strpos(mgmt_name, "INVESTORS SECURITY CO") | mgmt_cd=="ISE" 
replace family_name="JACKSON NATIONAL" if mgmt_cd== "JCK" | strpos(mgmt_name, "JACKSON NATIONAL")

replace family_name="JANUS" if strpos(mgmt_name, "JANUS") | mgmt_cd=="JAN"
replace family_name="JOHN HANCOCK" if strpos(mgmt_name, "JOHN HANCOCK") | strpos(mgmt_name, "J HANCOCK") | mgmt_cd=="JHA" | mgmt_cd=="JHI"
replace family_name="JP MORGAN" if mgmt_cd== "JPM" | mgmt_cd=="MOR" | strpos(mgmt_name, "JP MORGAN") | strpos(mgmt_name, "JPMORGAN")
replace family_name="KALMAR" if strpos(mgmt_name, "KALMAR") | mgmt_cd=="KIA"
replace family_name="KEELEY" if strpos(mgmt_name, "KEELEY")
replace family_name="KOBREN" if strpos(mgmt_name, "KOBREN INSIGHT") | mgmt_cd=="KBN" | mgmt_name=="INSIGHT MANAGEMENT"
replace family_name="KIEWIT INVESTMENT" if strpos(mgmt_name, "KIEWIT INVEST")

replace family_name="LEBENTHAL & CO" if strpos(mgmt_name, "LEBENTHAL & CO")
replace family_name="LEE MUNDER" if strpos(mgmt_name, "LEE MUNDER") 
replace family_name="LEGG MASON" if mgmt_cd=="LEG" | mgmt_cd== "LGW" | strpos(mgmt_name, "LEGG MASON")
replace family_name="LEPERCQ" if strpos(mgmt_name, "LEPERCQ")
replace family_name="LIBERTY FINANCIAL" if mgmt_name=="LIBERTY ASSET MGMT CO" | mgmt_name=="LIBERTY FUNDS" | mgmt_name=="LIBERTY BANK AND TRUST CO" 
replace family_name="LINCOLN INVESTMENT" if mgmt_cd== "JPI" | strpos(mgmt_name, "LINCOLN INVESTMENT ADVISORS") | strpos(mgmt_name, "LINCOLN NATIONAL LIFE")
replace family_name="LIPPER & COMPANY" if strpos(mgmt_name, "LIPPER & COMPANY")
replace family_name="LOTSOFF" if strpos(mgmt_name, "LOTSOFF")
replace family_name="LOWRY HILL" if strpos(mgmt_name, "LOWRY HILL") | mgmt_cd=="LHI"
replace family_name="LUTHER KING CAPITAL MANAGEMENT CORPORATION" if strpos(mgmt_name, "LUTHER KING CAPITAL MANAGEMENT CORP")
replace family_name="LUTHERAN BROTHERHOOD" if strpos(mgmt_name, "LUTHERAN BROTHERHOOD")
replace family_name="M&T" if strpos(mgmt_name, "M & T") | mgmt_cd=="MNT" 
replace family_name="MACKENZIE/IVY" if (mgmt_cd=="IVY" |  strpos(mgmt_name, "IVY") | strpos(mgmt_name, "MACKENZIE")) & !strpos(mgmt_name, "WADDELL")
replace family_name="MADISON" if strpos(mgmt_name, "MADISON INV ADVISORS") | strpos(mgmt_name, "MADISON INVESTMENT ADVISORS") | strpos(mgmt_name, "MADISON MOSAIC") | strpos(mgmt_name, "MADISON ASSET MANAGEMENT")
replace family_name="MANAGERS FUNDS" if strpos(mgmt_name, "MANAGERS FUNDS") | strpos(mgmt_name, "MANAGERS FUND L.P.")
replace family_name="MARKETOCRACY" if strpos(mgmt_name, "MARKETOCRACY") | mgmt_cd=="IGN"

replace family_name="MASON STREET" if strpos(mgmt_name, "MASON STREET") | mgmt_cd=="MSA"
replace family_name="MASSMUTUAL" if strpos(mgmt_name, "MASSMUTUAL") | mgmt_cd=="MML"
replace family_name="MATHERS & CO" if strpos(mgmt_name, "MATHERS AND CO") | mgmt_cd=="MTH"
replace family_name="MATTERHORN ASSET MANAGEMENT CORP" if strpos(mgmt_name, "MATTERHORN ASSET MANAGEMENT")
replace family_name="MATTHEWS INTL CAPITAL MANAGEMENT" if strpos(mgmt_name, "MATTHEWS INTL CAPITAL MANAGEMENT") | mgmt_cd=="MIN"
replace family_name="MAXUS ASSET MANAGEMENT" if strpos(mgmt_name, "MAXUS")
replace family_name="MERCANTILE CAPITAL ADVISORS" if strpos(mgmt_name, "MERCANTILE")
replace family_name="MERRILL LYNCH" if mgmt_cd== "MEL" | strpos(mgmt_name, "MERRILL LYNCH")
replace family_name="METLIFE" if strpos(mgmt_name, "METLIFE") |  strpos(mgmt_name, "METROPOLITAN LIFE INSURANCE") | strpos(mgmt_name, "MET INVESTORS")
replace family_name="MIDAS MANAGEMENT CORPORATION" if mgmt_cd=="BNB"
replace family_name="MILESTONE CAPITAL" if strpos(mgmt_name, "MILESTONE CAPITAL")
replace family_name="MILLER VALUE PARTNERS" if mgmt_cd=="LMM"
replace family_name="MORGAN STANLEY" if mgmt_cd=="MST" | strpos(mgmt_name, "MORGAN STANLEY") | strpos(mgmt_name, "MORG STAN") 
replace family_name="MUNDER CAPITAL" if strpos(mgmt_name, "MUNDER CAPITAL")
replace family_name="NATIONAL CITY BANK" if mgmt_cd== "NCC" | strpos(mgmt_name, "NATIONAL CITY") 
replace family_name="NATIONS" if (mgmt_cd== "NAS" | strpos(mgmt_name, "NATIONS")) & !strpos(mgmt_name, "TRANSNATIONS")
replace family_name="NATIONWIDE" if (mgmt_cd== "NFS" | strpos(mgmt_name, "NATIONWIDE")  | strpos(mgmt_name, "NATIONAWIDE")) & !strpos(fund_name, "GARTMORE") 

replace family_name="NEEDHAM INVESTMENT MANAGEMENT" if strpos(mgmt_name, "NEEDHAM INVESTMENT")
replace family_name="NEIMAN" if mgmt_cd== "NCM" | strpos(mgmt_name, "NEIMAN")
replace family_name="NEUBERGER BERMAN" if strpos(mgmt_name, "NEUBERGER") & strpos(mgmt_name, "BERMAN")
replace family_name="NEW YORK LIFE" if strpos(mgmt_name, "NEW YORK LIFE")
replace family_name="NICHOLAS COMPANY" if strpos(mgmt_name, "NICHOLAS CO")
replace family_name="NOMURA" if strpos(mgmt_name, "NOMURA ASSET")
replace family_name="NORTHEAST MANAGEMENT & RESEARCH" if strpos(mgmt_name, "NORTHEAST MANAGEMENT & RESEARCH")
replace family_name="NORTHERN TRUST" if mgmt_cd== "NTC" | strpos(mgmt_name, "NORTHERN TRUST")
replace family_name="NOTTINGHAM COMPANY" if strpos(mgmt_name, "NOTTINGHAM COMPANY")
replace family_name="NUVEEN" if mgmt_cd== "NUV" | strpos(mgmt_name, "NUVEEN") 
replace family_name="OAK RIDGE" if strpos(mgmt_name, "OAK RIDGE")
replace family_name="OFFITBANK" if strpos(mgmt_name, "OFFITBANK")
replace family_name="OHIO NATIONAL" if strpos(mgmt_name, "OHIO NATIONAL") | mgmt_cd=="QHN"
replace family_name="OPPENHEIMER" if strpos(mgmt_name, "OPPENHEIMER") | mgmt_cd=="OPP"
replace family_name="ORBITEX" if strpos(mgmt_name, "ORBITEX")
replace family_name="ORBITEX-SARATOGA" if strpos(mgmt_name, "ORBITEX-SARATOGA")
replace family_name="ORINDA" if (mgmt_cd== "ORI" | strpos(mgmt_name, "ORINDA")) 
replace family_name="O'SHAUGHNESSY" if strpos(mgmt_name, "O'SHAUGHNESSY")
replace family_name="PACIFIC LIFE" if mgmt_cd== "PLI" | strpos(mgmt_name, "PACIFIC LIFE") | strpos(mgmt_name, "PACIFIC MUTUAL LIFE GROUP")
replace family_name="PACIFIC GLOBAL" if strpos(mgmt_name, "PACIFIC GLOBAL INV") 
replace family_name="PAX WORLD MANAGEMENT" if strpos(mgmt_name, "PAX WORLD MANAGEMENT")
replace family_name="PAYDEN & RYGEL" if strpos(mgmt_name, "PAYDEN & RYGEL")
replace family_name="PENN CAPITAL MANAGEMENT COMPANY" if strpos(mgmt_name, "PENN CAPITAL MANAGEMENT COMPANY")
replace family_name="PERRITT" if mgmt_cd== "PRR" | strpos(mgmt_name, "PERRITT")
replace family_name="PHOENIX" if mgmt_cd=="PHX" | mgmt_cd=="PHA" | strpos(mgmt_name, "PHOENIX") 
replace family_name="PIMCO" if mgmt_cd== "PIM" | strpos(mgmt_name, "PIMCO")

replace family_name="PIONEER" if mgmt_cd== "PNE" | strpos(mgmt_name, "PIONEER")
replace family_name="PNC" if strpos(mgmt_name, "PNC")
replace family_name="PRINCIPAL MANAGEMENT" if strpos(mgmt_name, "PRINCIPAL")
replace family_name="PRO-CONSCIENCE" if strpos(mgmt_name, "PRO-CONSCIENCE") |  strpos(mgmt_name, "FEMMX FINANCIAL")
replace family_name="PROFUNDS" if mgmt_cd== "PFS" | strpos(mgmt_name, "PROFUND") | strpos(mgmt_name, "PROSHARE")

replace family_name="PRUDENTIAL" if mgmt_cd== "PRU" | strpos(mgmt_name, "PRUDENTIAL") | (strpos(mgmt_name, "JENNISON") & strpos(mgmt_name, "DRYDEN")) | strpos(mgmt_name, "STRATEGIC PARTNERS MUTUAL FUNDS")
replace family_name="PUTNAM" if mgmt_cd== "PUT" | strpos(mgmt_name, "PUTNAM")
replace family_name="R. MEEDER & ASSOCIATES" if (strpos(mgmt_name, "MEEDER") & strpos(mgmt_name, "ASSO")) | mgmt_cd=="MED"
replace family_name="RAFFERTY" if mgmt_cd== "RAM" | strpos(mgmt_name, "RAFFERTY") 
replace family_name="RAMIUS" if strpos(mgmt_name, "RAMIUS")
replace family_name="RBC" if mgmt_cd=="RBC" | mgmt_cd=="RBP" | mgmt_cd=="RBS"| mgmt_cd=="IFG"| strpos(mgmt_name, "ROYAL BANK OF CANADA") | strpos(mgmt_name, "RBC") 
replace family_name="RE ADVISERS" if strpos(mgmt_name, "RE ADVISERS")
replace family_name="REICH & TANG" if mgmt_cd== "RNT" | strpos(mgmt_name, "REICH & TANG")
replace family_name="REGAL INVESTMENT ADVISORS" if strpos(mgmt_name, "REGAL INVESTMENT ADVISORS")
replace family_name="RIDGEWORTH" if strpos(mgmt_name, "RIDGEWORTH")
replace family_name="RIGHTIME" if mgmt_cd== "RIT" | strpos(mgmt_name, "RIGHTIME")
replace family_name="ROBERT W BAIRD & COMPANY" if strpos(mgmt_name, "ROBERT W") & strpos(mgmt_name, "BAIRD")
replace family_name="ROTHSCHILD" if strpos(mgmt_name, "ROTHSCHILD")
replace family_name="ROULSTON & COMPANY" if strpos(mgmt_name, "ROULSTON") & strpos(mgmt_name, "COMPANY")
replace family_name="ROYAL BANK OF SCOTLAND" if mgmt_cd== "RBS" | mgmt_cd== "RBP" | strpos(mgmt_name, "ROYAL BANK OF SCOTLAND")
replace family_name="RUANE CUNIFF & GOLDFARB" if strpos(mgmt_name, "RUANE") & strpos(mgmt_name, "GOLDFARB")
replace family_name="RWN3" if mgmt_cd=="RWN"
replace family_name="RYDEX" if strpos(fund_name, "RYDEX")

replace family_name="SAFECO ASSET MANAGEMENT" if strpos(mgmt_name, "SAFECO ASSET MANAGEMENT") | mgmt_cd=="SAF"
replace family_name="SALIENT" if mgmt_cd== "SLP" | mgmt_cd== "SLT" | strpos(mgmt_name, "SALIENT") 

replace family_name="SANFORD C. BERNSTEIN" if mgmt_cd=="BRN" | (strpos(mgmt_name, "SANFORD") & strpos(mgmt_name, "BERNSTEIN"))
replace family_name="SARATOGA" if strpos(mgmt_name, "SARATOGA")
replace family_name="SCOUT INVESTMENTS" if mgmt_cd == "SIA"
replace family_name="SECURITIES MANAGEMENT & RESEARCH" if strpos(mgmt_name, "SECURITIES MANAGEMENT. & RESEARCH") | mgmt_cd=="SMR"
replace family_name="SEI" if (mgmt_cd== "SEI" | strpos(mgmt_name, "SEI"))  & !regex(mgmt_name, "SEIX")
replace family_name="SELECTED/VENTURE ADVISERS" if strpos(mgmt_name, "DAVIS SELECTED ADVISERS") | strpos(mgmt_name, "SELECTED/VENTURE")
replace family_name="SGI" if (mgmt_cd=="SMC" | strpos(mgmt_name, "SECURITY INVESTORS") | strpos(mgmt_name, "SECURITY MANAGEMENT CO")) & !strpos(mgmt_name, "GUGGENHEIM")
replace family_name="SELIGMAN" if mgmt_cd== "SLG" | mgmt_cd=="SEL"| strpos(mgmt_name, "SELIGMAN")
replace family_name="SENTINEL" if strpos(mgmt_name, "SENTINEL")  & !regex(mgmt_name, "SENTINEL CAPITAL SOLUTIONS") 
replace family_name="SENTRY" if strpos(mgmt_name, "SENTRY EQUITY SERVICES") | mgmt_cd=="SEN"
replace family_name="SHAY ASSETS" if mgmt_cd== "SHY" | strpos(mgmt_name, "SHAY ASSETS") 
replace family_name="SIT" if strpos(mgmt_name, "SIT MUTUAL FUNDS") | mgmt_cd=="SIT"
replace family_name="SKYLINE" if strpos(mgmt_name, "SKYLINE")
replace family_name="SMITH BARNEY" if mgmt_cd== "SBS" | strpos(mgmt_name, "SMITH BARNEY")
replace family_name="SMITH BREEDEN ASSOCIATES" if strpos(mgmt_name, "SMITH BREEDEN")
replace family_name="SOCIETE GENERALE" if strpos(mgmt_name, "SOCIETE GENERALE")
replace family_name="STAAR" if strpos(mgmt_name, "STAAR")
replace family_name="STANDISH" if mgmt_cd== "SAW" | strpos(mgmt_name, "STANDISH AYER & WOOD") 
replace family_name="STATE FARM" if strpos(mgmt_name, "STATE FARM")
replace family_name="STATE STREET" if mgmt_cd== "SSB" | mgmt_cd== "SSR" | mgmt_cd== "SSC" | mgmt_cd== "SSI"|  strpos(mgmt_name, "STATE STREET") | crsp_portno==1004197 
replace family_name="STEIN ROE" if strpos(mgmt_name, "STEIN ROE")
replace family_name="STERLING CAPITAL" if strpos(mgmt_name, "STERLING CAPITAL")
replace family_name="STOCKJUNGLE.COM" if strpos(mgmt_name, "STOCKJUNGLE.COM") | mgmt_cd=="SJC"
replace family_name="STONEBRIDGE" if (mgmt_cd== "STQ" | strpos(mgmt_name, "STONEBRIDGE")) & mgmt_cd!="SCV" 
replace family_name="STRATTON MANAGEMENT" if strpos(mgmt_name, "STRATTON MANAGEMENT")
replace family_name="STRONG CAPITAL MANAGEMENT" if strpos(mgmt_name, "STRONG CAPITAL MANAGEMENT") | strpos(mgmt_name, "STRONG/CORNELIUSON CAPITAL MANAGEMENT")

replace family_name="T ROWE PRICE" if mgmt_cd== "PRI" | strpos(mgmt_name, "ROWE PRICE")
replace family_name="TD" if mgmt_cd== "WTH"
replace family_name="TETON ADVISORS" if strpos(fund_name, "TETON WESTWOOD")
replace family_name="THIRD AVENUE" if strpos(mgmt_name, "THIRD AVENUE")
replace family_name="THOMPSON PLUMB" if mgmt_cd== "TPF" | strpos(mgmt_name, "THOMPSON PLUMB")
replace family_name="THORNBURG" if mgmt_cd== "THR" | strpos(mgmt_name, "THORNBURG")
replace family_name="THRIVENT" if (mgmt_cd== "AAL" & caldt > mdy(1,1,2005)) | mgmt_cd== "ALU"| (strpos(mgmt_name, "THRIVENT") & caldt > mdy(1,1,2005))
replace family_name="TIAA-CREF" if mgmt_cd== "TIA" | strpos(mgmt_name, "TIAA") | strpos(mgmt_name, "CREF") | strpos(mgmt_name, "TEACHERS INSURANCE & ANNUITY")
replace family_name="TIMESSQUARE" if mgmt_cd== "TMS" | mgmt_cd== "CIG" | strpos(mgmt_name, "TIMESSQUARE")
replace family_name="TITAN" if (strpos(mgmt_name, "TITAN") | mgmt_cd=="TTN") 
replace family_name="TORRAY CORPORATION" if (strpos(mgmt_name, "TORRAY") | mgmt_cd=="TOR") & mgmt_cd!="TRR"
replace family_name="TOREADOR RESEARCH & TRADING" if strpos(mgmt_name, "TOREADOR")
replace family_name="TRANSAMERICA" if mgmt_cd== "TRN" | strpos(mgmt_name, "TRANSAMERICA")
replace family_name="TRAINER WORTHAM & CO" if strpos(mgmt_name, "TRAINER WORTHAM")
replace family_name="TRILLIUM" if strpos(mgmt_name, "TRILLIUM")
replace family_name="UNDISCOVERED MANAGERS" if mgmt_cd== "UND" | strpos(mgmt_name, "UNDISCOVERED MANAGERS")
replace family_name="US BANCORP" if (strpos(mgmt_name, "US BANK") | strpos(mgmt_name, "US BANCORP") | mgmt_cd== "UBP" | mgmt_cd== "USB") & !strpos(mgmt_name, "FAF")
replace family_name="UBS" if mgmt_cd== "UBS" | mgmt_cd== "UBG" |  strpos(mgmt_name, "UBS")
replace family_name="US GLOBAL INVESTORS" if strpos(mgmt_name, "US GLOBAL INVESTORS") | mgmt_cd=="USF"
replace family_name="US TRUST" if (strpos(mgmt_name, "UNITED STATES TRUST CO OF NEW YORK") | strpos(mgmt_name, "US TRUST CO")) & !strpos(mgmt_name, "US TRUST CO OF BOSTON") 
replace family_name="VALIC" if strpos(mgmt_name, "VARIABLE ANNUITY") | strpos(mgmt_name, "VALIC")
replace family_name="VALLEY FORGE" if strpos(mgmt_name, "VALLEY FORGE") | strpos(mgmt_name, "VFM")
replace family_name="VAN ECK" if mgmt_cd== "VNE" | strpos(mgmt_name, "VAN ECK")
replace family_name="VAN KAMPEN" if strpos(fund_name, "VAN KAMP") | strpos(mgmt_name, "VAN KAMPEN ") | mgmt_cd=="VNK"
replace family_name="VANGUARD" if mgmt_cd== "VAN" | strpos(mgmt_name, "VANGUARD")
replace family_name="VICTORY" if mgmt_cd== "KYC" | strpos(mgmt_name, "VICTORY") 
replace family_name="VONTOBEL" if strpos(mgmt_name, "VONTOBEL") 
replace family_name="VIRTUS" if mgmt_cd=="VIR"| strpos(mgmt_name, "VIRTUS")
replace family_name="VONTOBEL" if strpos(mgmt_name, "VONTOBEL")
replace family_name="VOYAGEUR" if strpos(mgmt_name, "VOYAGEUR")
replace family_name="WADDELL & REED" if mgmt_cd== "WNR" | (strpos(mgmt_name, "WADDELL & REED") & !strpos(mgmt_name, "IVY"))
replace family_name="WALLACE R. WEITZ & CO" if strpos(mgmt_name, "WALLACE R. WEITZ")
replace family_name="WASATCH ADVISORS" if strpos(mgmt_name, "WASATCH")
replace family_name="WELLS FARGO" if mgmt_cd== "WFB" | strpos(mgmt_name, "WELLS FARGO") | strpos(mgmt_name, "WELLS ASSET") 
replace family_name="WESTERN ASSET" if mgmt_name=="WESTERN ASSET MANAGEMENT CO"
replace family_name="WESTON" if (mgmt_cd== "WES" | mgmt_cd== "WCA" | strpos(mgmt_name, "WESTON"))
replace family_name="WILBANKS SMITH & THOMAS" if strpos(mgmt_name, "WILBANKS SMITH & THOMAS")
replace family_name="WILMINGTON" if strpos(mgmt_name, "WILMINGTON")
replace family_name="WILSHIRE" if strpos(mgmt_name, "WILSHIRE") | mgmt_cd=="WLS"
replace family_name="WISDOMTREE" if mgmt_cd== "WTA" | strpos(mgmt_name, "WISDOMTREE")

replace family_name="WOOD STRUTHERS & WINTHROP MANAGEMENT" if strpos(mgmt_name, "WOOD STRUTHERS & WINTHROP")
replace family_name="ZIEGLER LOTSOFF" if mgmt_cd== "ZNC" | strpos(mgmt_name, "ZIEGLER") 
replace family_name="ZURICH KEMPER" if strpos(mgmt_name, "KEMPER FINANCIAL SERVICES") | strpos(mgmt_name, "ZURICH KEMPER") 
replace family_name="ZURICH SCUDDER" if strpos(mgmt_name, "SCUDDER") | mgmt_cd=="SCU" 

replace family_name=mgmt_name if strpos(mgmt_name, "3D PRINT")
replace family_name=mgmt_name if strpos(mgmt_name, "ALPHA INVESTMENT") & mgmt_cd=="APM"
replace family_name=mgmt_name if strpos(mgmt_name, "ARISTON") 
replace family_name=mgmt_name if strpos(mgmt_name, "ARROW")
replace family_name=mgmt_name if strpos(mgmt_name, "ALLIED INVESTMENT ADVISORS")
replace family_name=mgmt_name if strpos(mgmt_name, "BEACON GLOBAL ADVISORS")
replace family_name=mgmt_name if strpos(mgmt_name, "BOSTON COMMON ASSET")
replace family_name=mgmt_name if strpos(mgmt_name, "BRAMSHILL")
replace family_name=mgmt_name if strpos(mgmt_name, "BRINTON EATON")
replace family_name=mgmt_name if strpos(mgmt_name, "CAMBRIA INVESTMENT")
replace family_name="CHASE MANHATTAN" if strpos(mgmt_name, "CHASE MANHATTAN")
replace family_name=mgmt_name if strpos(mgmt_name, "CLARITY CAPITAL MANAGEMENT")
replace family_name=mgmt_name if strpos(mgmt_name, "CORNERCAP")
replace family_name=mgmt_name if strpos(mgmt_name, "COZAD ASSET MANAGEMENT")
replace family_name=mgmt_name if strpos(mgmt_name, "EDGEMONT ASSET MGMT")
replace family_name=mgmt_name if strpos(mgmt_name, "FIRST COMMERCE") 
replace family_name=mgmt_name if strpos(mgmt_name, "FIRST SUMMIT CAP MANAGEMENT")
replace family_name=mgmt_name if strpos(mgmt_name, "GOTHAM")
replace family_name=mgmt_name if strpos(mgmt_name, "GREENSPRING")
replace family_name=mgmt_name if strpos(mgmt_name, "HENNION & WALSH ASSET MANAGEMENT")
replace family_name=mgmt_name if strpos(mgmt_name, "MCMORGAN & COMPANY")
replace family_name=mgmt_name if strpos(mgmt_name, "KING INVESTMENT")
replace family_name=mgmt_name if strpos(mgmt_name, "MILES CAPITAL")
replace family_name="MORGAN CREEK" if strpos(mgmt_name, "MORGAN CREEK") 
replace family_name=mgmt_name if strpos(mgmt_name, "O'SHARES INVESTMENT")
replace family_name=mgmt_name if strpos(mgmt_name, "OAK RIDGE") 
replace family_name=mgmt_name if strpos(mgmt_name, "OPTA EXCHANGE TRADED NOTES")
replace family_name="PAINEWEBBER/MITCHELL HUTCHINS ASSET MANAGEMENT" if strpos(mgmt_name, "PAINEWEBBER") & caldt < mdy(11,3,2000) 
replace family_name=mgmt_name if strpos(mgmt_name, "RIVERNORTH CAPITAL MANAGEMENT")
replace family_name=mgmt_name if strpos(mgmt_name, "SCHAFER CAPITAL MGMT INC")
replace family_name="SCHRODER" if mgmt_cd== "SCH" | strpos(mgmt_name, "SCHRODER")
replace family_name=mgmt_name if strpos(mgmt_name, "SECURITIES MANAGEMENT & TIMING")
replace family_name=mgmt_name if strpos(mgmt_name, "SPOUTING ROCK FUND MANAGEMENT")
replace family_name="SCOTT S JAMES" if strpos(mgmt_name, "SCOTT S") & strpos(mgmt_name, "JAMES")
replace family_name=mgmt_name if strpos(mgmt_name, "STRATEGIC INVESTING")
replace family_name=mgmt_name if strpos(mgmt_name, "VIKING")
replace family_name=mgmt_name if strpos(mgmt_name, "WESTCAP")
replace family_name=mgmt_name if mgmt_cd=="TCM" 
replace family_name=mgmt_name if strpos(mgmt_name, "WISCONSIN CAPITAL MANAGEMENT")


	/* Re-define parent names */
gen parent_name = family_name

	/* Deal with fund families that merged/was acquired. Source: SDC Platinum */
replace parent_name="ALLIANCEBERNSTEIN" if (family_name=="ALLIANCE CAPITAL" | family_name=="SANFORD C. BERNSTEIN") & caldt >= mdy(10,2,2000) 
replace parent_name="ALLIANCEBERNSTEIN" if family_name=="WPS ADVISORS" & caldt >= mdy(12,12,2013)
replace parent_name="BT ALEX BROWN" if family_name=="ALEX & BROWN" & caldt < mdy(1,1,1997)
replace parent_name="DEUTSCHE" if family_name=="ALEX & BROWN" & caldt >= mdy(1,1,1999) & caldt < mdy(1,1,2016)
replace parent_name="RAYMOND JAMES" if family_name=="ALEX & BROWN" & caldt >= mdy(1,1,2016)
replace parent_name="ALLIANZ" if family_name=="HARTFORD" & caldt >= mdy(10,17,2008)
replace parent_name="ALLIANZ" if family_name=="NICHOLAS-APPLEGATE CAPITAL MANAGEMENT" & caldt >= mdy(2,14,2001)
replace parent_name="ALLIANZ" if family_name=="PIMCO" & caldt >= mdy(5,8,2000)
replace parent_name="ALLIANZ" if family_name=="QUESTAR CAPITAL CORP" & caldt >= mdy(11,17,2005)
replace parent_name="ALLIANZ" if family_name=="RCM CAPITAL MANAGEMENT" & caldt >= mdy(4,1,2013)
replace parent_name="ALLSTATE INSTITUTIONAL INVESTORS" if family_name=="AMERICAN HERITAGE" & caldt >= mdy(11,2,1999)
replace parent_name="AMERICAN BEACON ADVISORS" if family_name=="ARK INVESTMENT MANAGEMENT" & caldt >= mdy(7,14,2016)
replace parent_name="AMERICAN INDEPENDENCE FINANCIAL SVCS" if family_name=="FOLIOMETRIX" & caldt >= mdy(9,30,2015)  
replace parent_name="NOMURA" if family_name=="AMERICAN CENTURY" & caldt >= mdy(5,19,2016)
replace parent_name="AMERIPRISE" if family_name=="COLUMBIA" & caldt >= mdy(5,3,2010) 
replace parent_name="AMERIPRISE" if family_name=="GRAIL ADVISORS" & caldt >= mdy(4,14,2011)
replace parent_name="BANK OF AMERICA" if family_name=="COLUMBIA" & caldt < mdy(5,3,2010) 
replace parent_name="BANK OF AMERICA" if family_name=="FLEET INVESTMENT ADVISERS" & caldt >= mdy(4,1,2004) 
replace parent_name="BANK OF AMERICA" if family_name=="MERRILL LYNCH" & caldt >= mdy(1,1,2009)
replace parent_name="BANK OF AMERICA" if family_name=="US TRUST" & caldt >= mdy(7,2,2007) 
replace parent_name="BANK OF NEW YORK" if family_name=="GANNETT WELSH & KOTLER" & caldt >= mdy(5,6,2002)
replace parent_name="BANK OF NEW YORK" if family_name=="WHITEHALL ASSET MANAGEMENT" & caldt >= mdy(10,7,1999)
replace parent_name="BB&T" if family_name=="ONE VALLEY BANK N.A" & caldt >= mdy(7,7,2000) 
replace parent_name="BB&T" if family_name=="STERLING CAPITAL" & caldt >= mdy(4,1,2005) 
replace parent_name="BLACKROCK" if family_name=="BARCLAYS" & caldt >= mdy(12,1,2009) 
replace parent_name="BLACKROCK" if family_name=="MERRILL LYNCH" & caldt >= mdy(9,29,2006) & caldt < mdy(1,1,2009) 
replace parent_name="BMO" if family_name=="HARRIS TRUST"  
replace parent_name="BNYM" if family_name=="CUTWATER" & caldt >= mdy(1,2,2015) 
replace parent_name="BNYM" if family_name=="DREYFUS" & caldt >= mdy(7,2,2007) 
replace parent_name="BNYM" if (family_name=="STANDISH" | family_name=="MELLON INSTITUTIONAL FUNDS") & caldt >= mdy(7,31,2007) 
replace parent_name="CHARLES SCHWAB" if family_name=="US TRUST" & caldt >= mdy(6,1,2000) & caldt < mdy(7,2,2007) 
replace parent_name="CHASE MANHATTAN" if family_name=="HAMBRECHT & QUIST CAP MANAGEMENT" & caldt >= mdy(12,10,1999) 
replace parent_name="COLUMBIA" if family_name=="EMERGING GLOBAL SHARES" & caldt >= mdy(9,1,2016)
replace parent_name="CREDIT SUISSE" if family_name=="WARBURG PINCUS COUNSELLORS INC" & caldt >= mdy(7,6,1999)
replace parent_name="DEUTSCHE" if family_name=="RREEF AMERICA" & caldt >= mdy(4,24,2002)
replace parent_name="DEUTSCHE" if family_name=="XSHARES ADVISORS" & caldt >= mdy(7,30,2010)
replace parent_name="DEUTSCHE" if family_name== "ZURICH SCUDDER" & caldt >= mdy(4,8,2002) 
replace parent_name="EATON VANCE" if family_name=="CALVERT" & caldt >= mdy(12,30,2016) 
replace parent_name="EATON VANCE" if family_name=="FOX ASSET MANAGEMENT" & caldt >= mdy(10,2,2001)
replace parent_name="EATON VANCE" if family_name=="VOYAGEUR" & caldt >= mdy(12,1,2005)
replace parent_name="EATON VANCE" if family_name=="WESTON" & caldt >= mdy(8,2,2005)
replace parent_name="EVERGREEN" if family_name=="GOLDEN CAPITAL MANAGEMENT" & caldt >= mdy(10,1,2005)  
replace parent_name="FEDERATED" if family_name=="CLOVER CAPITAL MANAGEMENT" & caldt >= mdy(12,2,2008)
replace parent_name="FEDERATED" if family_name=="EDGEMOOR CAPITAL MANAGEMENT" & caldt >= mdy(4,23,2001)
replace parent_name="FEDERATED" if family_name=="FIRSTMERIT BANK" & caldt >= mdy(8,28,2002)
replace parent_name="FEDERATED" if family_name=="INVESTMENT ADVISERS INC" & caldt >= mdy(9,18,2000)
replace parent_name="FIERA" if family_name=="ROTHSCHILD" & caldt >= mdy(9,1,2016) 
replace parent_name="FIFTH THIRD" if family_name=="MAXUS ASSET MANAGEMENT" & caldt >= mdy(1,3,2001) 
replace parent_name="FIFTH THIRD" if family_name=="OLD KENT BANK" & caldt >= mdy(4,2,2001)
replace parent_name="FLEET INVESTMENT ADVISERS" if family_name=="BANKBOSTON N.A" & caldt >= mdy(10,1,1999) 
replace parent_name="FLEET INVESTMENT ADVISERS" if family_name=="LIBERTY FINANCIAL" & caldt >= mdy(11,1,2001) 
replace parent_name="FLEET INVESTMENT ADVISERS" if family_name=="SUMMIT BANK" & caldt >= mdy(3,1,2001) 
replace parent_name="FRIEDMAN BILLINGS RAMSEY & CO" if family_name=="FBR FUND ADVISORS" & caldt < mdy(10,26,2012) 
replace parent_name="FRIEDMAN BILLINGS RAMSEY & CO" if family_name=="MONEY MANAGEMENT ASSOCIATES" & caldt >= mdy(4,2,2001) 
replace parent_name="GE ASSET MANAGMENT" if family_name=="SECURITY CAPITAL RESEARCH & MANAGEMENT" & caldt >= mdy(5,14,2002)
replace parent_name="GENWORTH FINANCIAL WEALTH MANAGEMENT" if family_name=="ALTEGRIS ADVISORS" & caldt >= mdy(5,14,2002)
replace parent_name="GUARDIAN INVESTOR SERVICES" if family_name=="RS INVESTMENT MANAGEMENT CO" & caldt >= mdy(5,17,2006) & caldt < mdy(7,9,2016)
replace parent_name="GUGGENHEIM" if family_name=="CLAYMORE" & caldt >=mdy(10,14,2009)
replace parent_name="HARTFORD" if family_name=="FORTIS" & caldt >=mdy(2,19,2002)
replace parent_name="HENNESSY" if family_name=="FBR FUND ADVISORS" & caldt >= mdy(10,26,2012) 

replace parent_name="HENNESSY" if family_name=="LINDNER ASSET MANAGMENT" & caldt >=mdy(2,27,2004)
replace parent_name="INVESCO" if family_name=="AIM" & caldt >= mdy(11,5,1996) 
replace parent_name="INVESCO" if family_name=="VAN KAMPEN" & caldt >= mdy(6,1,2010) 
replace parent_name="INVESCO" if family_name=="OPPENHEIMER" & caldt >= mdy(5,24,2019) 
replace parent_name="JOHN HANCOCK" if family_name=="OPTIQUE CAPITAL MANAGEMENT" & caldt >=mdy(2,11,2011)
replace parent_name="JP MORGAN CHASE" if (family_name=="JP MORGAN" | family_name=="CHASE MANHATTAN") & caldt >= mdy(12,31,2000) 
replace parent_name="JP MORGAN CHASE" if family_name=="BANC ONE" & caldt >= mdy(7,1,2004) 
replace parent_name="JP MORGAN CHASE" if family_name=="GLOBAL X MANAGEMENT COMPANY" & caldt >= mdy(4,4,2016)
replace parent_name="JP MORGAN CHASE" if family_name=="BEAR STEARNS" & caldt >= mdy(5,30,2008)
replace parent_name="LEE MUNDER" if family_name=="DAVID L. BABSON & CO" & caldt >= mdy(4,25,2006) 
replace parent_name="LEGG MASON" if family_name=="BARRETT ASSOCIATES" & caldt >= mdy(2,5,2001)
replace parent_name="LEGG MASON" if family_name=="PERMAL ASSET MANAGEMENT" & caldt >= mdy(11,13,2005)
replace parent_name="LEGG MASON" if family_name=="PRECIDIAN FUNDS" & caldt >= mdy(1,22,2016)
replace parent_name="LEGG MASON" if family_name=="PRIVATE CAPITAL MANAGEMENT" & caldt >= mdy(8,1,2001)
replace parent_name="LEGG MASON" if family_name=="ROYCE & ASSOCIATES" & caldt >= mdy(10,1,2001)
replace parent_name="LEGG MASON" if family_name=="WESTERN ASSET" 
replace parent_name="LINCOLN INVESTMENT" if family_name=="DELAWARE MANAGEMENT COMPANY" & caldt < mdy(1,4,2010) 

replace parent_name="MACQUARIE" if family_name=="DELAWARE MANAGEMENT COMPANY" & caldt >= mdy(1,4,2010)
replace parent_name="M&T" if family_name=="ALLFIRST" & caldt >= mdy(4,1,2013) 
replace parent_name="M&T" if family_name=="WILMINGTON" & caldt >= mdy(5,16,2011)
replace parent_name="MARSHALL & ILSLEY CORP" if family_name=="MISSISSIPPI VALLEY ADV" & caldt >= mdy(10,1,2002)  
replace parent_name="MASSMUTUAL" if family_name=="DAVID L. BABSON & CO" & caldt < mdy(4,25,2006)  
replace parent_name="MIRAE ASSET GLOBAL INVESTMENTS (USA)" if family_name=="HORIZONS ETFS MANAGEMENT (USA)" & caldt >= mdy(11,14,2011)
replace parent_name="MONTAGE" if family_name=="GIRALDA" & caldt >= mdy(12,5,2012) 
replace parent_name="MUFG" if family_name=="RYDEX" & caldt >= mdy(10,4,2016) 
replace parent_name="MUFG" if family_name=="UNION BANK OF CALIFORNIA" & caldt >= mdy(11,4,2008)
replace parent_name="MUNDER CAPITAL" if family_name=="INTEGRITY ASSET MANAGEMENT" 
replace parent_name="NATIONAL CITY BANK" if family_name=="ALLEGIANT" & caldt >= mdy(4,9,2004) 

replace parent_name="NATIONWIDE" if family_name=="GARTMORE" 
replace parent_name="NEUBERGER BERMAN" if family_name=="FASCIANO COMPANY" & caldt >= mdy(3,6,2001) 
replace parent_name="NEUBERGER BERMAN" if family_name=="GLICKENHAUS & COMPANY" & caldt >= mdy(10,15,2012)
replace parent_name="NEW YORK LIFE" if family_name=="INDEXIQ ADVISORS" & caldt >=mdy(4,15,2015)
replace parent_name="NEW YORK LIFE" if family_name=="INSTITUTIONAL CAPITAL CORPORATION" & caldt >=mdy(6,30,2006)
replace parent_name="NEW YORK LIFE" if family_name=="MCMORGAN & COMPANY" & caldt >=mdy(9,28,2001)
replace parent_name="NORTHERN TRUST" if family_name=="CARL DOMINO & ASSOC" & caldt >=mdy(5,2,2000)
replace parent_name="NUVEEN" if family_name=="FAF" & caldt >= mdy(12,31,2010) 

replace parent_name="NVEST FUND MANAGEMENT" if family_name=="GATEWAY INVESTMENT ADVISERS" & caldt >=mdy(2,19,2008)
replace parent_name="OPPENHEIMER" if family_name=="STEELPATH FUND ADVISORS" & caldt >= mdy(12,4,2012)
replace parent_name="OPPENHEIMER" if family_name=="VTL ASSOCIATES" & caldt >= mdy(9,9,2015)
replace parent_name="ORBITEX-SARATOGA" if (family_name=="ORBITEX" & caldt >= mdy(6,30,2003))  |  (family_name=="SARATOGA" & caldt >= mdy(6,30,2003)) 
replace parent_name="PHOENIX" if family_name=="VIRTUS" & caldt < mdy(12,31,2008) 

replace parent_name="PHOENIX" if family_name=="ZWEIG/GLASER ADVISERS" & year(caldt) > 1999 & caldt < mdy(12,31,2008) 
replace parent_name="PACIFIC LIFE" if family_name=="PIMCO" & caldt < mdy(5,5,2000) 
replace parent_name="PNC" if family_name=="NATIONAL CITY BANK" & caldt >= mdy(12,31,2008)
replace parent_name="PNC" if family_name=="MERCANTILE" & caldt >= mdy(3,2,2007)  
replace parent_name="PNC" if family_name=="RIGGS NATL BANK OF WASH DC" & caldt >= mdy(5,13,2005)
replace parent_name="PRUDENTIAL" if family_name=="JACKSON NATIONAL" 
replace parent_name="PRUDENTIAL" if family_name=="AMERICAN SKANDIA" & caldt >= mdy(5,1,2003)
replace parent_name="RAYMOND JAMES" if family_name=="SCOUT INVESTMENTS" & caldt >= mdy(11,20,2017)
replace parent_name="RBC" if family_name=="WILLIAM R. HOUGH & CO" & caldt >= mdy(2,27,2004) 
replace parent_name="RBC" if family_name=="VOYAGEUR" & caldt < mdy(12,1,2005) 

replace parent_name="ROYAL BANK OF SCOTLAND" if family_name=="CITIZENS BANK" & year(caldt) >= 1988 & caldt < mdy(9,24,2014) 
replace parent_name="SALIENT" if family_name=="FORWARD" & caldt >= mdy(6,10,2015) 

replace parent_name="SENTINEL" if family_name=="BRAMWELL CAPITAL" & caldt >= mdy(2,8,2006)
replace parent_name="SENTINEL" if family_name=="CITIZENS ADVISERS" 
replace parent_name="SGI" if family_name=="RYDEX" & caldt >= mdy(1,18,2008) & caldt < mdy(10,4,2016)


replace parent_name="TA ASSOCIATES" if family_name=="NUMERIC INVESTORS" & caldt >= mdy(6,17,2004) 
replace parent_name="TA ASSOCIATES" if family_name=="KEELEY" & caldt >= mdy(7,23,2008)
replace parent_name="TA ASSOCIATES" if family_name=="STADION MONEY MANAGEMENT" & caldt >= mdy(4,26,2011)
replace parent_name="TCW INVESTMENT MANAGEMENT COMPANY" if family_name=="METROPOLITAN WEST ASSET MANAGEMENT" & caldt >= mdy(12,14,2009)
replace parent_name="TETON ADVISORS" if family_name=="KEELEY" & caldt >= mdy(3,1,2017)
replace parent_name="TOUCHSTONE ADVISORS" if family_name=="SENTINEL" & caldt >= mdy(10,30,2017)
replace parent_name="UBS" if family_name=="PAINEWEBBER/MITCHELL HUTCHINS ASSET MANAGEMENT" & caldt >= mdy(11,3,2000) 
replace parent_name="UMB" if family_name=="SCOUT INVESTMENTS" & caldt < mdy(11,20,2017) 
replace parent_name="US BANCORP" if family_name=="FAF" & caldt < mdy(12,31,2010) 
replace parent_name="US BANCORP" if family_name=="FIDUCIARY MANAGEMENT INC" & caldt >= mdy(10,5,2009)
replace parent_name="US BANCORP" if family_name=="FIRSTAR" & caldt >= mdy(2,27,2001) 
replace parent_name="VICTORY" if family_name=="MUNDER CAPITAL" & caldt >= mdy(10,31,2014) 

replace parent_name="VICTORY" if family_name=="NEWBRIDGE PARTNERS" & caldt >= mdy(6,30,2003)
replace parent_name="VICTORY" if family_name=="COMPASS EFFICIENT MODEL PORTFOLIOS" & caldt >= mdy(5,1,2015)
replace parent_name="VICTORY" if family_name=="RS INVESTMENT MANAGEMENT CO" & caldt >= mdy(7,9,2016)
replace parent_name="VIRTUS" if family_name=="KAYNE ANDERSON INVESTMENT MANAGEMENT" 
replace parent_name="VIRTUS" if family_name=="RIDGEWORTH" & caldt >= mdy(6,1,2017)
replace parent_name="WADDELL & REED IVY" if family_name=="WADDELL & REED" | (family_name=="MACKENZIE/IVY" & caldt >= mdy(12,17,2002)) 

replace parent_name="WADDELL & REED IVY" if family_name=="ADVANTUS CAPITAL" & caldt >= mdy(12,8,2003) 
replace parent_name="WELLS FARGO" if family_name=="LOWRY HILL" 
replace parent_name="WELLS FARGO" if family_name=="GOLDEN CAPITAL MANAGEMENT" & caldt >= mdy(10,10,2011)
replace parent_name="WELLS FARGO" if family_name=="MONTGOMERY ASSET MANAGEMENT" & caldt >= mdy(1,17,2003)
replace parent_name="WISDOMTREE" if family_name=="GREENHAVEN COMMODITY SERVICES" & caldt >= mdy(1,4,2006)
replace parent_name="ZIEGLER LOTSOFF" if family_name=="LOTSOFF" & caldt >= mdy(6,10,2011) 


	/* Keep the following lines HERE and DON'T change the order */

replace parent_name="CITY NATIONAL" if parent_name=="LEE MUNDER" & caldt >= mdy(8,5,2009) 
replace parent_name="GE ASSET MANAGMENT" if parent_name=="GENWORTH FINANCIAL WEALTH MANAGEMENT" & caldt < mdy(5,25,2004) 


replace parent_name="EQUITABLE LIFE ASSUR SOC" if (parent_name=="ALLIANCE CAPITAL" | parent_name=="ALLIANCEBERNSTEIN") & year(caldt) > 1985
replace parent_name="AXA" if parent_name=="EQUITABLE LIFE ASSUR SOC" & year(caldt) > 1991 
replace parent_name="LEHMAN BROTHERS" if parent_name=="NEUBERGER BERMAN" & caldt >= mdy(10,31,2003) & caldt < mdy(10,31,2011) 

replace parent_name="GOLDMAN SACHS" if parent_name=="LEHMAN BROTHERS" & caldt >=mdy(10,31,2011)
replace parent_name="GUGGENHEIM" if parent_name=="SGI" & caldt >= mdy(8,2,2010) 

replace parent_name="KEYCORP" if parent_name=="VICTORY" & caldt < mdy(8,1,2013)
replace parent_name="MASSMUTUAL" if parent_name=="OPPENHEIMER" &  year(caldt) > 1990 
replace parent_name="PNC" if parent_name=="BLACKROCK" & year(caldt) > 1995 
replace parent_name="RBC" if parent_name=="CITY NATIONAL" & caldt >= mdy(11,2,2015) 

replace parent_name="SOCIETE GENERALE" if parent_name=="TCW INVESTMENT MANAGEMENT COMPANY" & caldt >= mdy(7,9,2001) & caldt < mdy(2,6,2013)
replace parent_name="CARLYLE GMS INVESTMENT MANAGEMENT" if parent_name=="TCW INVESTMENT MANAGEMENT COMPANY" & caldt >= mdy(2,6,2013)

replace parent_name="TIAA-CREF" if parent_name=="NUVEEN" & caldt >= mdy(10,1,2014) 
replace parent_name="WACHOVIA BANK OF NC" if parent_name=="EVERGREEN" & caldt >= mdy(8,3,2001) 

replace parent_name="CONGRESS ASSET MANAGEMENT COMPANY" if parent_name=="CENTURY CAPITAL MANAGEMENT" & caldt >= mdy(9,20,2017)
replace parent_name="IMPAX ASSET MANAGEMENT GROUP" if parent_name=="PAX WORLD MANAGEMENT" & caldt >= mdy(1,19,2018)
replace parent_name="SHELTON CAPITAL MANAGEMENT" if parent_name=="CEDAR RIDGE PARTNERS" & caldt >= mdy(1,30,2019)
replace parent_name="CALAMOS" if parent_name=="TIMPANI CAPITAL MANAGEMENT" & caldt >= mdy(6,3,2019)

drop if missing(parent_name) 
keep if year(caldt) >= 2006 & year(caldt) <= 2022
sort caldt fund_name




